package light.mvc.model.item;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import light.mvc.model.base.IdEntity;
import light.mvc.model.register.TmedicinePrescription;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "medicine")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Tmedicine extends IdEntity implements java.io.Serializable {
	private static final long serialVersionUID = 1L;
	
	private String name;
	private String description;
	private String effect;
	private String component;
	private String specification;
	
	private Date productionDate;
	private Integer guranteePeriod;
	private Double price;
	
	private Set<TmedicinePrescription> medicinePrescriptions = new HashSet<TmedicinePrescription>(0);
	
	@OneToMany(mappedBy = "medicine")
	public Set<TmedicinePrescription> getMedicinePrescriptions() {
		return medicinePrescriptions;
	}
	public void setMedicinePrescriptions(
			Set<TmedicinePrescription> medicinePrescriptions) {
		this.medicinePrescriptions = medicinePrescriptions;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getEffect() {
		return effect;
	}
	public void setEffect(String effect) {
		this.effect = effect;
	}
	public String getComponent() {
		return component;
	}
	public void setComponent(String component) {
		this.component = component;
	}
	
	public String getSpecification() {
		return specification;
	}
	public void setSpecification(String specification) {
		this.specification = specification;
	}
	
	public Date getProductionDate() {
		return productionDate;
	}
	public void setProductionDate(Date productionDate) {
		this.productionDate = productionDate;
	}
	
	public Integer getGuranteePeriod() {
		return guranteePeriod;
	}
	public void setGuranteePeriod(Integer guranteePeriod) {
		this.guranteePeriod = guranteePeriod;
	}
	public Double getPrice() {
		return price;
	}
	public void setPrice(Double price) {
		this.price = price;
	}
	
}
